$(document).ready(function(){ 
	$("input:button").each(
		function(index){
			var btnId = this.id;
			var advertisementId = btnId.substring(6,btnId.length);
			$("#" + this.id).bind("click", {'id':advertisementId}, function(e){
				butClick(e); 
			});
    })
}); 
function butClick(e) { 
	Confirm("广告实体删除", "确认删除此广告实体？", function(){
		$.post("/advertisement/"+e.data.id+"/del", function(res){
			if(res.status == 'ok'){
				success(res.message);
				setTimeout(window.location.reload(),5000);
			}else{
				error(res.message);
				setTimeout(window.location.reload(),5000);
			}
		});
	});
}



